<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml" xmlns:family="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>用户表</title>
    <!-- 下面的2行是一个放大缩小的插件，当我们用手机去连接时，可以让其放大缩小，类似于2345浏览器手机版-->
    <link rel="icon" th:href="@{/img/favicon.ico}"/>
    <link href="asserts/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/4.0.0/css/bootstrap.css}" rel="stylesheet">
    <!-- 要用下面的ajax的判断删除是否成功需要引下面的包-->
    <script th:src="@{/webjars/jquery/jquery.min.js}"></script>
</head>
<!-- 在body里面设置整体的背景图片-->
<body style="background: url('http://web.ccpgamescdn.com/evevalkyrie/images/wallpapers/Gateway/Gatewaywallpaper1920x1080.jpg')">


<!-- 设置下面3个表的位置-->

<div>

    <div style="margin-left: 596px;margin-top: 293px">
<!--a class="play-btn"herf="javascript:void(0);"data-mp4="https://xz.v.netease.com/2018/0929/d609831f1bb5f1956c8a0e4cd30055caqt.mp4"></a-->
        <embed src="https://xz.v.netease.com/2018/0929/d609831f1bb5f1956c8a0e4cd30055caqt.mp4" width="741" height="402"  ></embed>
    </div>

        <div class="col-12" style="margin-left:59px;margin-top:-648px;color:cyan">用户列表</span></div>

        <div class="col-10" style="margin-top: 50px">

            <table class="col-4" style=" margin-left: 59px;margin-top: 39px;color:cyan">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>姓名</th>
                    <th>密码</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="user:${users}">
                    <td th:text="${user.id}"></td>
                    <td th:text="${user.username}"></td>
                    <td th:text="${user.password}"></td>
                    <td>
                        <!--<a   th:href="@{/delete?(id=${user.id})}">删除</a>-->
                       <!--input type="button" onclick="login(${user.id})"value="删除"-->
                        <!--<button onclick="login(${user.id})">删除</button>-->
                        <!--button onc>删除</button-->
                        <button th:onclick="'javascript:login(\''+${user.id}+'\');'">删除</button>

                    </td>

                </tr>
                </tbody>
            </table>

        </div>
    <div>
        <h1 style="position: absolute;z-index: 3; left:859px; top: 69px;color: deepskyblue;"><font size="20"><font color="#00bfff">跃迁引擎启动</h1>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="button" onclick="index()" style="margin-left: 905px";top="120"><font color="#87cefa"><font size="4">开启量子传输</button>
            </div>
        </div>
    </div>
</div>
    <script type="text/javascript">
        function  login(str) {
            $.ajax({
                type: "get",
                url: "/delete?id="+str,
                success: function(data){
                    if (data == "1"){
                        alert("删除成功")
                        window.location.reload()
                    }else {
                        alert("删除失败")
                        false
                    }
                }
            });
        }
        function index() {
            location.href = '/index'
        }
    </script>

</table>



</body>
</html>